/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canteen.sys.model.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;

/**
 *
 * @author TNT
 */
@Entity
@Table(uniqueConstraints = {
    @UniqueConstraint(columnNames = {"deptId", "subDepartmentName"})})
public class SubDepartmentMaster implements Serializable {

    @Id
    @GeneratedValue
    private int subDeptId;
    @ManyToOne
    @JoinColumn(name = "deptId")
    private DepartmentMaster department;
    @NotNull
    @Column(length = 50)
    private String subDepartmentName;
    @NotNull
    private boolean status;

    public DepartmentMaster getDepartment() {
        return department;
    }

    public void setDepartment(DepartmentMaster department) {
        this.department = department;
    }

    public SubDepartmentMaster(int subDeptId, String subDepartmentName, boolean status) {
        this.subDeptId = subDeptId;
        this.subDepartmentName = subDepartmentName;
        this.status = status;
    }

    public SubDepartmentMaster() {
    }

    public int getSubDeptId() {
        return subDeptId;
    }

    public void setSubDeptId(int subDeptId) {
        this.subDeptId = subDeptId;
    }

    public String getSubDepartmentName() {
        return subDepartmentName;
    }

    public void setSubDepartmentName(String subDepartmentName) {
        this.subDepartmentName = subDepartmentName;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }
}
